This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.

Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Cmd+Shift+Enter.

# Sys.getenv("RSTUDIO_PANDOC")
# Sys.setenv(RSTUDIO_PANDOC= "/c/Program Files/RStudio/bin/pandoc/")
# remove.packages('vctrs')
# install.packages('vctrs')
# packageVersion('vctrs')
library(namespace)
library(corrplot)
corrplot 0.84 loaded
require("survival")
Loading required package: survival
require(statar)
Loading required package: statar
library(statar)
library(ggplot2)
library(ggpubr)
library(readxl)
library(tidyr)
pan_immune_matrix=readxl::read_xlsx('../data/1-s2.0-S1074761318301213-mmc2.xlsx')
New names:
* Eosinophils -> Eosinophils...41
* Neutrophils -> Neutrophils...48
* Neutrophils -> Neutrophils...60
* Eosinophils -> Eosinophils...61
pan_immune_matrix
pan_immune_matrix_prep= pan_immune_matrix[,-c(1, 3, 4)]
pan_immune_matrix_prep=data.frame(pan_immune_matrix_prep[,1], apply(pan_immune_matrix_prep[,-1], 2, as.numeric))
Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion

Warning in apply(pan_immune_matrix_prep[, -1], 2, as.numeric): NAs introduced by
coercion
immune_cells_by_cancerType=aggregate(.~TCGA.Study , pan_immune_matrix_prep,
                                     function(x) median(x, na.rm=T),  na.action = NULL)

rownames(immune_cells_by_cancerType)=immune_cells_by_cancerType$TCGA.Study
immune_cells_by_cancerType=rbind(immune_cells_by_cancerType, 
                                 NSCLC=c('NSCLC',colMeans(immune_cells_by_cancerType[
                                   immune_cells_by_cancerType$TCGA.Study=='LUSC'|
                                     immune_cells_by_cancerType$TCGA.Study=='LUAD',-(1)])))
immune_cells_by_cancerType=data.frame(apply(immune_cells_by_cancerType[,-1], 2, as.numeric),
                                      row.names = rownames(immune_cells_by_cancerType))

colnames(immune_cells_by_cancerType)
 [1] "Leukocyte.Fraction"                     
 [2] "Stromal.Fraction"                       
 [3] "Intratumor.Heterogeneity"               
 [4] "TIL.Regional.Fraction"                  
 [5] "Proliferation"                          
 [6] "Wound.Healing"                          
 [7] "Macrophage.Regulation"                  
 [8] "Lymphocyte.Infiltration.Signature.Score"
 [9] "IFN.gamma.Response"                     
[10] "TGF.beta.Response"                      
[11] "SNV.Neoantigens"                        
[12] "Indel.Neoantigens"                      
[13] "Silent.Mutation.Rate"                   
[14] "Nonsilent.Mutation.Rate"                
[15] "Number.of.Segments"                     
[16] "Fraction.Altered"                       
[17] "Aneuploidy.Score"                       
[18] "Homologous.Recombination.Defects"       
[19] "BCR.Evenness"                           
[20] "BCR.Shannon"                            
[21] "BCR.Richness"                           
[22] "TCR.Shannon"                            
[23] "TCR.Richness"                           
[24] "TCR.Evenness"                           
[25] "CTA.Score"                              
[26] "Th1.Cells"                              
[27] "Th2.Cells"                              
[28] "Th17.Cells"                             
[29] "OS"                                     
[30] "OS.Time"                                
[31] "PFI"                                    
[32] "PFI.Time"                               
[33] "B.Cells.Memory"                         
[34] "B.Cells.Naive"                          
[35] "Dendritic.Cells.Activated"              
[36] "Dendritic.Cells.Resting"                
[37] "Eosinophils...41"                       
[38] "Macrophages.M0"                         
[39] "Macrophages.M1"                         
[40] "Macrophages.M2"                         
[41] "Mast.Cells.Activated"                   
[42] "Mast.Cells.Resting"                     
[43] "Monocytes"                              
[44] "Neutrophils...48"                       
[45] "NK.Cells.Activated"                     
[46] "NK.Cells.Resting"                       
[47] "Plasma.Cells"                           
[48] "T.Cells.CD4.Memory.Activated"           
[49] "T.Cells.CD4.Memory.Resting"             
[50] "T.Cells.CD4.Naive"                      
[51] "T.Cells.CD8"                            
[52] "T.Cells.Follicular.Helper"              
[53] "T.Cells.gamma.delta"                    
[54] "T.Cells.Regulatory.Tregs"               
[55] "Lymphocytes"                            
[56] "Neutrophils...60"                       
[57] "Eosinophils...61"                       
[58] "Mast.Cells"                             
[59] "Dendritic.Cells"                        
[60] "Macrophages"                            
Leukocyte.Fraction

Stromal.Fraction

Intratumor.Heterogeneity

TIL.Regional.Fraction

Proliferation

Wound.Healing

Macrophage.Regulation

Lymphocyte.Infiltration.Signature.Score

IFN.gamma.Response

TGF.beta.Response

SNV.Neoantigens

Indel.Neoantigens

Silent.Mutation.Rate

Nonsilent.Mutation.Rate

Number.of.Segments

Fraction.Altered

Aneuploidy.Score

Homologous.Recombination.Defects

BCR.Evenness

BCR.Shannon

BCR.Richness

TCR.Shannon

TCR.Richness

TCR.Evenness

CTA.Score

Th1.Cells

Th2.Cells

Th17.Cells

OS

OS.Time

PFI

PFI.Time

B.Cells.Memory

B.Cells.Naive

Dendritic.Cells.Activated

Dendritic.Cells.Resting

Eosinophils...41

Macrophages.M0

Macrophages.M1

Macrophages.M2

Mast.Cells.Activated

Mast.Cells.Resting

Monocytes

Neutrophils...48

NK.Cells.Activated

NK.Cells.Resting

Plasma.Cells

T.Cells.CD4.Memory.Activated

T.Cells.CD4.Memory.Resting

T.Cells.CD4.Naive

T.Cells.CD8

T.Cells.Follicular.Helper

T.Cells.gamma.delta

T.Cells.Regulatory.Tregs

Lymphocytes

Neutrophils...60

Eosinophils...61

Mast.Cells

Dendritic.Cells

Macrophages
non_immune_signature=c("Proliferation", "Wound.Healing", "Intratumor.Heterogeneity",
                        "SNV.Neoantigens",
                       "Indel.Neoantigens","Silent.Mutation.Rate","Nonsilent.Mutation.Rate",
                       "Number.of.Segments","Fraction.Altered",
                       "Aneuploidy.Score",
                       "Homologous.Recombination.Defects")

immune_signature=c("Macrophage.Regulation","Lymphocyte.Infiltration.Signature.Score",
                   "IFN.gamma.Response","TGF.beta.Response", "IFN.gamma.Response",
                   "BCR.Evenness", "BCR.Shannon", "BCR.Richness","TCR.Shannon",
                       "TCR.Richness","TCR.Evenness", "TGF.beta.Response")

to_remove=c("OS", "OS.Time", "PFI", "PFI.Time", "Neutrophils...60", "Eosinophils...61")
immune_cells_by_cancerType=immune_cells_by_cancerType[,!(colnames(immune_cells_by_cancerType) %in% to_remove)]
colnames(immune_cells_by_cancerType)
 [1] "Leukocyte.Fraction"                     
 [2] "Stromal.Fraction"                       
 [3] "Intratumor.Heterogeneity"               
 [4] "TIL.Regional.Fraction"                  
 [5] "Proliferation"                          
 [6] "Wound.Healing"                          
 [7] "Macrophage.Regulation"                  
 [8] "Lymphocyte.Infiltration.Signature.Score"
 [9] "IFN.gamma.Response"                     
[10] "TGF.beta.Response"                      
[11] "SNV.Neoantigens"                        
[12] "Indel.Neoantigens"                      
[13] "Silent.Mutation.Rate"                   
[14] "Nonsilent.Mutation.Rate"                
[15] "Number.of.Segments"                     
[16] "Fraction.Altered"                       
[17] "Aneuploidy.Score"                       
[18] "Homologous.Recombination.Defects"       
[19] "BCR.Evenness"                           
[20] "BCR.Shannon"                            
[21] "BCR.Richness"                           
[22] "TCR.Shannon"                            
[23] "TCR.Richness"                           
[24] "TCR.Evenness"                           
[25] "CTA.Score"                              
[26] "Th1.Cells"                              
[27] "Th2.Cells"                              
[28] "Th17.Cells"                             
[29] "B.Cells.Memory"                         
[30] "B.Cells.Naive"                          
[31] "Dendritic.Cells.Activated"              
[32] "Dendritic.Cells.Resting"                
[33] "Eosinophils...41"                       
[34] "Macrophages.M0"                         
[35] "Macrophages.M1"                         
[36] "Macrophages.M2"                         
[37] "Mast.Cells.Activated"                   
[38] "Mast.Cells.Resting"                     
[39] "Monocytes"                              
[40] "Neutrophils...48"                       
[41] "NK.Cells.Activated"                     
[42] "NK.Cells.Resting"                       
[43] "Plasma.Cells"                           
[44] "T.Cells.CD4.Memory.Activated"           
[45] "T.Cells.CD4.Memory.Resting"             
[46] "T.Cells.CD4.Naive"                      
[47] "T.Cells.CD8"                            
[48] "T.Cells.Follicular.Helper"              
[49] "T.Cells.gamma.delta"                    
[50] "T.Cells.Regulatory.Tregs"               
[51] "Lymphocytes"                            
[52] "Mast.Cells"                             
[53] "Dendritic.Cells"                        
[54] "Macrophages"                            
Leukocyte.Fraction

Stromal.Fraction

Intratumor.Heterogeneity

TIL.Regional.Fraction

Proliferation

Wound.Healing

Macrophage.Regulation

Lymphocyte.Infiltration.Signature.Score

IFN.gamma.Response

TGF.beta.Response

SNV.Neoantigens

Indel.Neoantigens

Silent.Mutation.Rate

Nonsilent.Mutation.Rate

Number.of.Segments

Fraction.Altered

Aneuploidy.Score

Homologous.Recombination.Defects

BCR.Evenness

BCR.Shannon

BCR.Richness

TCR.Shannon

TCR.Richness

TCR.Evenness

CTA.Score

Th1.Cells

Th2.Cells

Th17.Cells

B.Cells.Memory

B.Cells.Naive

Dendritic.Cells.Activated

Dendritic.Cells.Resting

Eosinophils...41

Macrophages.M0

Macrophages.M1

Macrophages.M2

Mast.Cells.Activated

Mast.Cells.Resting

Monocytes

Neutrophils...48

NK.Cells.Activated

NK.Cells.Resting

Plasma.Cells

T.Cells.CD4.Memory.Activated

T.Cells.CD4.Memory.Resting

T.Cells.CD4.Naive

T.Cells.CD8

T.Cells.Follicular.Helper

T.Cells.gamma.delta

T.Cells.Regulatory.Tregs

Lymphocytes

Mast.Cells

Dendritic.Cells

Macrophages
# Immune_matrix_TCGA= t(immune_cells_by_cancerType)
Immune_Cell_abundance=immune_cells_by_cancerType[,!(colnames(immune_cells_by_cancerType) %in% c(non_immune_signature, immune_signature))]
Immune_Signature_abundance=immune_cells_by_cancerType[,colnames(immune_cells_by_cancerType) %in%  immune_signature]
nonImmune_Signature_abundance=immune_cells_by_cancerType[,colnames(immune_cells_by_cancerType) %in%  non_immune_signature]
colnames(Immune_Cell_abundance)[grep('Neutrophils',colnames(Immune_Cell_abundance))]='Neutrophils'
immune_factor= read.csv("../data/immune_factors_response_joo_v2.csv", row.names = 1)

f1=18/(18+31); f2=1-f1
immune_factor$COAD= sapply(seq(1:nrow(immune_factor)), function (x) 
  (as.numeric(immune_factor[x,'COAD_MSI'])* f1 + as.numeric(immune_factor[x,'COAD_MSS'])* f2))
immune_factor$NSCLC= sapply(seq(1:nrow(immune_factor)), function (x) 
  (immune_factor[x,'LUAD']* 0.5 + immune_factor[x,'LUAD']* 0.5))

immune_factor= data.frame(t(immune_factor))
# mapping=match(rownames(immune_factor), rownames(Immune_Cell_abundance))
# immune_factor$Lymphocytes=(Immune_Cell_abundance$Lymphocytes)[mapping]
# immune_factor$NTL=(Immune_Cell_abundance$Neutrophils/Immune_Cell_abundance$Lymphocytes)[mapping]

colnames(immune_factor)[grep('CPS',colnames(immune_factor))]=
  'PDL1 (combined positive score)'

Add a new chunk by clicking the Insert Chunk button on the toolbar or by pressing Cmd+Option+I.

When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Cmd+Shift+K to preview the HTML file).

The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.

LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKVGhpcyBpcyBhbiBbUiBNYXJrZG93bl0oaHR0cDovL3JtYXJrZG93bi5yc3R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